package com.dhecp.project.flowable.domain;

import com.dhecp.common.core.domain.BaseEntity;
import com.dhecp.core.constant.FlowableConstant;
import com.fasterxml.jackson.annotation.JsonFormat;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * @ClassName FlowTask
 * @Description 自定义流程任务
 * @Author alula
 * @Date 2019-11-29 11:44
 */
public class SysProcessInstance extends BaseEntity {
    private static final long serialVersionUID = 1L;
    private String guid;
    private String processTitle;  //流程标题
    private String procDefId;  //流程定义ID
    private String procInstId; //流程实例ID
    private String procDefKey; //流程定义KEY
    private String procDefName; //流程定义名称
    private Integer procDefVersion; //流程定义版本
    private String procDeplId;    //部署ID
    private String organizer;   //发起人
    private String organizerName; //发起人姓名
    private String corpNo;   //所属公司NO
    private String corpName; //所属公司名称
    private String tableDataId;  //业务数据表ID
    private String routeUrl;   //业务功能地址
    private String routeName;   //业务功能名称
    private String prevTaskId;  //上个任务ID
    private String nextTaskId; //下个任务ID
    private String prevActId;  //上一个节点Id
    private String nextActId;  //下一个节点Id
    private String nextActAlias;//下一个节点别名
    private String processRemark;//流程备注
    private String actComment;  //环节意见
    private String actFuncKey;   //审批环节功能KEY
    private String actFormPage;  //审批环节跳转页面
    private boolean actFuncIsEdit = false; //审批环节是否可编辑
    private Integer dataStatus = FlowableConstant.STATUS_TO_APPLY;     //数据状态
    private Integer resultStatus = FlowableConstant.RESULT_TO_SUBMIT;  //结果状态
    private boolean deleted = false;  //删除标志
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date startFlowTime;
    private String dataStatusName;
    private String resultStatusName;

    private Map<String, Object> params = new HashMap<>(16);

    public String getGuid() {
        return guid;
    }

    public void setGuid(String guid) {
        this.guid = guid;
    }

    public String getProcessTitle() {
        return processTitle;
    }

    public void setProcessTitle(String processTitle) {
        this.processTitle = processTitle;
    }

    public String getProcDefId() {
        return procDefId;
    }

    public void setProcDefId(String procDefId) {
        this.procDefId = procDefId;
    }

    public String getProcInstId() {
        return procInstId;
    }

    public void setProcInstId(String procInstId) {
        this.procInstId = procInstId;
    }

    public String getProcDefKey() {
        return procDefKey;
    }

    public void setProcDefKey(String procDefKey) {
        this.procDefKey = procDefKey;
    }

    public String getProcDefName() {
        return procDefName;
    }

    public void setProcDefName(String procDefName) {
        this.procDefName = procDefName;
    }

    public Integer getProcDefVersion() {
        return procDefVersion;
    }

    public void setProcDefVersion(Integer procDefVersion) {
        this.procDefVersion = procDefVersion;
    }

    public String getProcDeplId() {
        return procDeplId;
    }

    public void setProcDeplId(String procDeplId) {
        this.procDeplId = procDeplId;
    }

    public String getOrganizer() {
        return organizer;
    }

    public void setOrganizer(String organizer) {
        this.organizer = organizer;
    }

    public String getOrganizerName() {
        return organizerName;
    }

    public void setOrganizerName(String organizerName) {
        this.organizerName = organizerName;
    }

    public String getCorpNo() {
        return corpNo;
    }

    public void setCorpNo(String corpNo) {
        this.corpNo = corpNo;
    }

    public String getCorpName() {
        return corpName;
    }

    public void setCorpName(String corpName) {
        this.corpName = corpName;
    }

    public String getTableDataId() {
        return tableDataId;
    }

    public void setTableDataId(String tableDataId) {
        this.tableDataId = tableDataId;
    }

    public String getRouteUrl() {
        return routeUrl;
    }

    public void setRouteUrl(String routeUrl) {
        this.routeUrl = routeUrl;
    }

    public String getRouteName() {
        return routeName;
    }

    public void setRouteName(String routeName) {
        this.routeName = routeName;
    }

    public String getPrevTaskId() {
        return prevTaskId;
    }

    public void setPrevTaskId(String prevTaskId) {
        this.prevTaskId = prevTaskId;
    }

    public String getNextTaskId() {
        return nextTaskId;
    }

    public void setNextTaskId(String nextTaskId) {
        this.nextTaskId = nextTaskId;
    }

    public String getPrevActId() {
        return prevActId;
    }

    public void setPrevActId(String prevActId) {
        this.prevActId = prevActId;
    }

    public String getNextActId() {
        return nextActId;
    }

    public void setNextActId(String nextActId) {
        this.nextActId = nextActId;
    }

    public String getNextActAlias() {
        return nextActAlias;
    }

    public void setNextActAlias(String nextActAlias) {
        this.nextActAlias = nextActAlias;
    }

    public String getProcessRemark() {
        return processRemark;
    }

    public void setProcessRemark(String processRemark) {
        this.processRemark = processRemark;
    }

    public String getActComment() {
        return actComment;
    }

    public void setActComment(String actComment) {
        this.actComment = actComment;
    }

    public String getActFuncKey() {
        return actFuncKey;
    }

    public void setActFuncKey(String actFuncKey) {
        this.actFuncKey = actFuncKey;
    }

    public String getActFormPage() {
        return actFormPage;
    }

    public void setActFormPage(String actFormPage) {
        this.actFormPage = actFormPage;
    }

    public boolean getActFuncIsEdit() {
        return actFuncIsEdit;
    }

    public void setActFuncIsEdit(boolean actFuncIsEdit) {
        this.actFuncIsEdit = actFuncIsEdit;
    }

    public Integer getDataStatus() {
        return dataStatus;
    }

    public void setDataStatus(Integer dataStatus) {
        this.dataStatus = dataStatus;
    }

    public Integer getResultStatus() {
        return resultStatus;
    }

    public void setResultStatus(Integer resultStatus) {
        this.resultStatus = resultStatus;
    }

    public boolean getDeleted() {
        return deleted;
    }

    public void setDeleted(boolean deleted) {
        this.deleted = deleted;
    }

    public Date getStartFlowTime() {
        return startFlowTime;
    }

    public void setStartFlowTime(Date startFlowTime) {
        this.startFlowTime = startFlowTime;
    }

    public String getDataStatusName() {
        String result = "";
        switch (this.dataStatus){
            case 1:
                result = "处理中";
                break;
            case 2:
                result = "处理结束";
                break;
            default:
                result = "待处理";
        }
        return  result;
    }

    public String getResultStatusName() {
        String result = "";
        switch (this.resultStatus){
            case 1:
                result = "处理中";
                break;
            case 2:
                result = "通过";
                break;
            case 3:
                result = "驳回";
                break;
            case 4:
                result = "委托";
                break;
            case 5:
                result = "撤回";
                break;
            case 6:
                result = "删除";
                break;
            default:
                result = "待提交";
        }
        return  result;
    }

    public Map<String, Object> getParams() {
        return params;
    }

    public void setParams(Map<String, Object> params) {
        this.params = params;
    }
}
